package homework4;

import java.util.Scanner;

//递归求 N 的阶乘
public class T7 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int n = sc.nextInt();
            System.out.println(Fac(n));
        }

        sc.close();
    }


    public static int Fac(int n) {
        if (n == 1 || n == 2) {
            return n;
        } else {
            return Fac(n - 1) * n;
        }

    }
}
